<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <title>地理位置选择</title>
    <style type="text/css">
        .map-link {
            display: inline-block;
            position: relative;
        }
        .map-link img {
            width: 50px;
            height: 50px;
        }
        .map-link .map-popup {
            display: none;
            position: absolute;
            top: 60px;
            left: 0;
            width: 400px;
            height: 400px;
            background-color: #fff;
            border: 1px solid #ccc;
            z-index: 9999;
        }
        .map-link .map-popup iframe {
            width: 100%;
            height: 100%;
            border: none;
        }
    </style>
</head>

<body>
    <div class="form-group">
        <label for="house-address">详细地址</label>
        <textarea class="form-control" name="address" id="house-address" required></textarea>
        <div class="map-link">
            <img src="static\images\地理位置.png" alt="图片描述">
            <div class="map-popup">
                <iframe src="" frameborder="0"></iframe>
            </div>
        </div>
    </div>

    <script>
        function handleClick() {
            var mapUrl = "https://map.baidu.com/search/%E5%85%A8%E5%9B%BD/@12940178,4861887,13z?querytype=s&wd=%E5%85%A8%E5%9B%BD&c=1&provider=pc-aladin&pn=0&device_ratio=2&da_src=shareurl";
            var popup = $(".map-popup");
            var iframe = popup.find("iframe");
            iframe.attr("src", mapUrl);
            popup.show();
        }

        $(function () {
            $(".map-link").on("click", function (e) {
                e.stopPropagation();
            });

            $(document).on("click", function () {
                $(".map-popup").hide();
            });
        });
    </script>
</body>

</html>